import { get, post, del, put } from "@/utils/request";
import {
  type badListParams,
  type badListReturn,
  type bedAddParams,
  type badListData,
} from "./type";

// 床位列表
export const bedList = (data: badListParams) => {
  return get<badListParams, badListReturn>("/api/beds/list", data);
};

// 床位添加
export const bedAdd = (data: bedAddParams) => {
  return post<bedAddParams, badListData>("/api/beds/add", data);
};

// 床位修改
export const bedUpdate = (data: bedAddParams) => {
  return put<bedAddParams, badListData>("/api/beds/update", data);
};

// 床位删除
export const bedDel = (id: number) => {
  return del<number, null>(`/api/beds/delete/${id}`);
};

// 批量删除
export const bedDelAll = (data: number[]) => {
  return post<number[], null>("/api/beds/deleteAll", data);
};
